﻿using UnityEngine;
using System.Collections;

public class Hand : MonoBehaviour {
	private int maxHandSize = 7;
	public Card[] hand;
	public int currentSize = 0;
	// Use this for initialization
	void Start () {
		Card[] hand = new Card[maxHandSize];
	}

	public void afterPlay(int i){
		int currentIndex = i;
		while((currentIndex < maxHandSize - 1) && (hand[currentIndex+1]!=null)){
			hand[currentIndex] = hand[currentIndex+1];
			hand[currentIndex].handPositon--;
			hand[currentIndex].transform.position = new Vector3(hand[currentIndex].transform.position.x - 1, hand[currentIndex].transform.position.y, hand[currentIndex].transform.position.z);
			currentIndex++;
		}
		hand[currentIndex] = null;
		currentSize--;
	}
}
